package com.example.sls.controller.user;

import com.example.sls.pojo.user.Faq;
import com.example.sls.service.intserfaces.user.FaqService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 常见疑难解答表(Faq)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:43
 */
@RestController
@RequestMapping("user/faq")
public class FaqController {
  @Autowired
  FaqService faqService;

  @GetMapping("queryById")
  Faq queryById(Integer id) {
    return faqService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<Faq> queryAllByLimit(Faq faq, Integer pageSize, Integer offset) {
    return faqService.queryAllByLimit(faq, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return faqService.count();
  }

  @GetMapping("insert")
  int insert(Faq faq) {
    return faqService.insert(faq);
  }

  @GetMapping("update")
  int update(Faq faq) {
    return faqService.update(faq);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return faqService.deleteById(id);
  }
}

